using System;
using System.Collections.Generic;
using System.Text;
using OgilvyOne.DALFactory;
using OgilvyOne.IDAL;
using OgilvyOne.Model;
using System.Collections;
using System.Web.UI.WebControls;


namespace OgilvyOne.BLL
{
    public class DownLoad
    {
        // Methods
        public void Delete(int download_id)
        {
            OgilvyOne.DALFactory.DownLoad.Create().Delete(download_id);
        }

        public void dropdownlistbind(DropDownList drop, string selectvalue)
        {
            IList list = OgilvyOne.DALFactory.DownLoad.Create().DropDownListBind();
            drop.DataSource = list;
            drop.DataTextField = "TYPE_NAME";
            drop.DataValueField = "TYPE_ID";
            drop.DataBind();
            foreach (ListItem item in drop.Items)
            {
                if ((item.Value == selectvalue) && (selectvalue != "0"))
                {
                    item.Selected = true;
                }
            }
        }

        public void dropdownlistbindpicture(DropDownList drop, string selectvalue, int menu_uid)
        {
            IList list = OgilvyOne.DALFactory.DownLoad.Create().DropDownListBindpicture(menu_uid);
            drop.DataSource = list;
            drop.DataTextField = "TYPE_NAME";
            drop.DataValueField = "TYPE_ID";
            drop.DataBind();
            foreach (ListItem item in drop.Items)
            {
                if ((item.Value == selectvalue) && (selectvalue != "0"))
                {
                    item.Selected = true;
                }
            }
        }

        public IList getAllConDownLoadList(int menu_uid)
        {
            return OgilvyOne.DALFactory.DownLoad.Create().getAllConDownLoadList(menu_uid);
        }

        public IList getconDownLoadList(int con_id)
        {
            return OgilvyOne.DALFactory.DownLoad.Create().getconDownLoadList(con_id);
        }

        public DownLoadInfo getDownLoadinfo(int download_id)
        {
            return OgilvyOne.DALFactory.DownLoad.Create().getDownLoadInfo(download_id);
        }

        public IList getDownLoadList(int MENU_UID)
        {
            return OgilvyOne.DALFactory.DownLoad.Create().getDownLoadList(MENU_UID);
        }

        public void Insert(DownLoadInfo downloadinfo)
        {
            OgilvyOne.DALFactory.DownLoad.Create().Insert(downloadinfo);
        }

        public void Update(DownLoadInfo downloadinfo)
        {
            OgilvyOne.DALFactory.DownLoad.Create().Update(downloadinfo);
        }

    }
}
